package com.hxzy.springbootrocketconsumer.service;

import com.hxzy.springbootrocketconsumer.dto.User;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * 消费者消费
 * @author Fan
 * 继承 RocketMQListener 泛型实体类User
 * finished
 */
@Service
@RocketMQMessageListener(topic = "RLT_DEMO_TOPIC",selectorExpression = "user01", consumerGroup = "consumer_user")
public class ConsumerService implements RocketMQListener<User> {


    @Override
    public void onMessage(User user) {
        System.out.println("对象:"+user.toString());
    }




}
